<template>
<div>
	<h3 class="base-title">文本域</h3>
	<p class="base-content">用于输入多行文本信息，通过将 type 属性的值指定为 textarea。</p>

	<div class="demo-block" :class="{'show-case-core':caseObj1.showCoreFlag}">
		<div class="demo-block-source">
			<bh-input type='textarea' :rows="2" placeholder="请输入内容1" v-model="input1"></bh-input>
		</div>
		<div class="demo-block-core">
			<div class="demo-block-intro">文本域高度可通过 rows 属性控制</div>
			<textarea class="demo-core-box" readonly="readonly" v-model="caseSourceVal" style='height: 160px;'></textarea>
		</div>
		<div class="demo-block-footer">
			<div class="demo-ms-arr" @click='toggleDemoCore(caseObj1)'>
				<span class="demo-ms-s">显示代码</span>
				<span class="demo-ms-h">隐藏代码</span>
			</div>
			<a :href="caseObj1.coreUrl" target="_blank" class="demo-online" title="前往 codepen.io 运行此示例">在线运行</a>
		</div>
	</div>
</div>
</template>

<script>
const caseSourceVal = `
<bh-input type='textarea' :rows="2" placeholder="请输入内容1" v-model="input1"></bh-input>

export default {
	data () {
		return {
			input1: '111',
		};
	},
}
`;
export default {
	data () {
		return {
			caseObj1: {
				showCoreFlag: false,
				coreUrl: 'https://codepen.io/xiebaolin/pen/ExvapRr',
			},
			caseSourceVal: caseSourceVal,

			input1: '111',
		};
	},
	methods: {
		// 切换代码显隐
		toggleDemoCore (item) {
			item.showCoreFlag = !item.showCoreFlag;
		},
	},
}
</script>

<style scoped>
</style>
